<?php
namespace app\home\controller;

use think\Cache;
use think\Db;

class Basedata extends Base
{
    public function goods()
    {
        $data['status'] = 200;
        $data['msg']    = 'success';

        $data['data']['page']      = 1;                                                      //当前页
        $data['data']['records']   =100;   //总条数
        $data['data']['total']     = 10;                       //总分页数

        $list=array();
        foreach ($list as $arr=>$row) {
            $v[$arr]['amount']        = (float)$row['amount'];
            $v[$arr]['barCode']       = '';
            $v[$arr]['number']        = $row['number'];
            $v[$arr]['categoryName']  = $row['categoryname'];
            $v[$arr]['id']       = intval($row['id']);
            $v[$arr]['name']     = $row['name'];
            $v[$arr]['josl']     = '';
            $v[$arr]['purPrice'] = $row['purprice'];
            $v[$arr]['quantity'] = $row['quantity'];
            $v[$arr]['salePrice']= $row['saleprice'];
            $v[$arr]['spec']     = $row['spec'];
            $v[$arr]['unitCost'] = $row['unitcost'];
            $v[$arr]['unitId']   = $row['unitid'];
            $v[$arr]['unitName'] = $row['unitname'];
            $v[$arr]['localtionName'] = 'a';
            $v[$arr]['locationId'] = 1;
        }
        $data['data']['rows']   = $v;

        return json($data);
    }
}